package com.ruoci.redis.requestlimit.file;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @Author yang
 **/
@Documented
@Target({ElementType.METHOD,ElementType.PARAMETER,ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {FileTypeValidator.class})
public @interface AllowedFileTypes {

     String message() default "Illegal file type";
     String[] allowedFileTypes()
     default {"doc","docx","xls","xlsx","ppt","pptx","pdf","jpeg","jpg","png","gif","bmp"};

     Class<?>[] groups() default {};

     Class<? extends Payload>[] payload() default {};

     @Documented
     @Target({ElementType.TYPE})
     @Retention(RetentionPolicy.RUNTIME)
     @interface List {
          AllowedFileTypes[] value();
     }
}
